package com.cskaoyan.wordmemorize.controller.app;


import com.cskaoyan.wordmemorize.auth.StpKit;
import com.cskaoyan.wordmemorize.common.result.Result;
import com.cskaoyan.wordmemorize.dto.app.UserPageDTO;
import com.cskaoyan.wordmemorize.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/voc/my")
public class PageController {

    @Autowired
    UserService userService;

    @GetMapping("/page")
    public Result<UserPageDTO> getUserPageInfo() {
        Long userId = StpKit.USER.getLoginIdAsLong();
        UserPageDTO userPageDTO = userService.getUserPage(userId);
        return Result.ok(userPageDTO);
    }
}
